/********************************************************************************************************************************************************
DO-FILE TO REPLICATE: Ferrer, Hernández, Prada AND Tomic (2025) The Value of Liberal Democracy: Assessing Citizens' Commitment to Democratic Principles
********************************************************************************************************************************************************/

**************
* PREAMBLE
**************
* ROOT DIRECTORY 

capture: cd "" 

* DIRECTORY STRUCTURE
global data "00_original_data/"  
global working "01_working_data/"  
global output "02_output/"  
global aux "04_aux/"

* Plots scheme 
set scheme white_tableau

*******************************
* CONJOINT DATASET PREPARATION
*******************************

******************
* DATA MANAGEMENT
******************
use "${working}conjoint_general_final.dta", replace

*elections
tab elections
encode elections, gen(elections_c)
replace elections_c=1 if elections_c==1 | elections_c==4 | elections_c==5| elections_c==7| elections_c==9 | elections_c==12 | elections_c==14
replace elections_c=0 if elections_c==2 | elections_c==3 | elections_c==6| elections_c==8| elections_c==10 | elections_c==11| elections_c==13
label define elections_c 1 "Not Free" 0 "Free (baseline)", replace
label val elections_c elections_c
tab elections_c


*media 
tab media
encode media, gen(media_c)
replace media_c =0 if media_c ==2 |media_c ==4 |media_c ==5|media_c ==6 |media_c ==8 |media_c ==12 | media_c ==14
replace media_c =1 if media_c == 1|media_c ==3 |media_c ==7 |media_c ==9 |media_c ==10 |media_c ==11 | media_c ==13
label define media_c 1 "Not allowed to criticise" 0 "Free (baseline)", replace
label val media_c media_c
tab media_c


* protest
tab protest 
encode protest, gen(protest_c)
replace protest_c =0 if protest_c ==2 |protest_c ==3 |protest_c ==5 |protest_c ==7|protest_c ==8|protest_c ==9|protest_c ==13
replace protest_c =1 if protest_c ==1 |protest_c ==4 |protest_c ==6 |protest_c ==10|protest_c ==11|protest_c ==12|protest_c ==14
label define protest_c 1 "Restrictions on demonstrations" 0 "Free (baseline)", replace
label val protest_c protest_c
tab protest_c

* laws
tab laws
encode laws, gen(laws_c)
replace laws_c=0 if laws_c==2 |laws_c==3|laws_c==5|laws_c==7|laws_c==10|laws_c==12|laws_c==14
replace laws_c=1 if laws_c==1|laws_c==4|laws_c==6|laws_c==8|laws_c==9|laws_c==11|laws_c==13
label define laws_c 1 "Gov. bends the law" 0 "Gov. follows the law (baseline)", replace
label val laws_c laws_c
tab laws_c


* parliament
tab parliament
encode parliament, gen(parliament_c)
replace parliament_c=0 if parliament_c==1 | parliament_c==3| parliament_c==5| parliament_c==6| parliament_c==8| parliament_c==11| parliament_c==13
replace parliament_c=1 if parliament_c==2 | parliament_c==4| parliament_c==7| parliament_c==9| parliament_c==10| parliament_c==12| parliament_c==14
label define parliament_c 1 "Gov. bypasses parliament" 0 "Gov. subject to control (baseline)", replace
label val parliament_c parliament_c
tab parliament_c


* judges
tab judges
encode judges, gen(judges_c)
replace judges_c=0 if judges_c==1  | judges_c==3| judges_c==5| judges_c==7| judges_c==10| judges_c==11| judges_c==13
replace judges_c=1 if judges_c==2  | judges_c==4| judges_c==6| judges_c==8| judges_c==9| judges_c==12| judges_c==14
label define judges_c 1 "Gov. ignores court rulings" 0 "Gov. abides by court rulings", replace
label val judges_c judges_c
tab judges_c


*income
tab income
encode income, gen(income_en)
tab income_en
gen income_c=.
replace income_c=0 if income=="2400 €" & Country=="Spain" | income=="1700 €" & Country=="Portugal" | income=="£3,400"| income=="40 200 kr"| income=="443 000 Ft"| income=="6300 zł"| income=="₪15,300"
replace income_c=1 if income=="1900 €" & Country=="Spain" | income=="1300 €" & Country=="Portugal" | income=="£2,700"| income=="32 200 kr"| income=="354 000 Ft"| income_en==1 | income=="₪12,300"
replace income_c=2 if income=="2200 €" & Country=="Spain" | income=="1500 €" & Country=="Portugal" | income=="£3,100"| income=="36 200 kr"| income=="399 000 Ft"| income=="5700 zł"| income=="₪13,800"
replace income_c=3 if income=="2700 €" & Country=="Spain" | income=="1900 €" & Country=="Portugal" | income=="£3,700"| income=="44 200 kr"| income=="487 000 Ft"| income=="6900 zł"| income=="₪16,900"
replace income_c=4 if income=="3000 €" & Country=="Spain" | income=="2100 €" & Country=="Portugal" | income=="£4,200"| income=="50 300 kr"| income=="554 000 Ft"| income=="7900 zł"| income=="₪19,200"


label define income_c 0 "Avg. income (baseline)" 1 "0.8 times avg. income" 2 "0.9 times avg. income" 3 "1.1 times avg. income" 4 "1.25 times avg. income", replace
label val income_c income_c
tab income_c
encode Country, gen(Country_c)

tab income_c Country_c


label var elections_c Elections
label var media_c Media
label var protest_c "Protests and demonstrations"
label var laws_c Laws
label var parliament_c Parliament
label var judges_c "Judges and courts"
label var income_c Income

* Income categorical oredered 
recode income_c (1=0) (2=1) (0=2)

label def income_new 0"0.8 times avg. income" 1"0.9 times avg. income" 2"Avg. income (baseline)" 3"1.1 times avg. income" 4"1.25 times avg. income"

label val income_c income_new

* Income continuous 
gen income_norm =.
replace income_norm=0.8 if income_c==0
replace income_norm=0.9 if income_c==1
replace income_norm=1 if income_c==2
replace income_norm=1.1 if income_c==3
replace income_norm=1.25 if income_c==4
label var income_norm "Income (normalized)"

** Income $PPPP 

* Spain 
gen income_real =.
replace income_real=1900 if income_c==0 & Country == "Spain"
replace income_real=2200 if income_c==1 & Country == "Spain"
replace income_real=2400 if income_c==2 & Country == "Spain"
replace income_real=2700 if income_c==3 & Country == "Spain"
replace income_real=3000 if income_c==4 & Country == "Spain" 
label var income_real "Income (real)"

gen income_thousands_ppp = . 
replace income_thousands_ppp=2.857 if income_c==0 & Country == "Spain"
replace income_thousands_ppp=3.214 if income_c==1 & Country == "Spain"
replace income_thousands_ppp=3.572 if income_c==2 & Country == "Spain"
replace income_thousands_ppp=3.929 if income_c==3 & Country == "Spain"
replace income_thousands_ppp=4.465 if income_c==4 & Country == "Spain"
label var income_thousands_ppp "Income $1000 PPP" 

* Hungary
replace income_real=354000 if income_c==0 & Country == "Hungary"
replace income_real=399000 if income_c==1 & Country == "Hungary"
replace income_real=443000 if income_c==2 & Country == "Hungary"
replace income_real=487000 if income_c==3 & Country == "Hungary"
replace income_real=554000 if income_c==4 & Country == "Hungary"

replace income_thousands_ppp=1.898 if income_c==0 & Country == "Hungary"
replace income_thousands_ppp=2.136 if income_c==1 & Country == "Hungary"
replace income_thousands_ppp=2.373 if income_c==2 & Country == "Hungary"
replace income_thousands_ppp=2.610 if income_c==3 & Country == "Hungary"
replace income_thousands_ppp=2.966 if income_c==4 & Country == "Hungary"

*Israel
replace income_real=12300 if income_c==0 & Country == "Israel"
replace income_real=13800 if income_c==1 & Country == "Israel"
replace income_real=15300 if income_c==2 & Country == "Israel"
replace income_real=16900 if income_c==3 & Country == "Israel"
replace income_real=19200 if income_c==4 & Country == "Israel"

replace income_thousands_ppp=2.944 if income_c==0 & Country == "Israel"
replace income_thousands_ppp=3.312 if income_c==1 & Country == "Israel"
replace income_thousands_ppp=3.680 if income_c==2 & Country == "Israel"
replace income_thousands_ppp=4.048 if income_c==3 & Country == "Israel"
replace income_thousands_ppp=4.600 if income_c==4 & Country == "Israel"

*Poland
replace income_real=5000 if income_c==0 & Country == "Poland"
replace income_real=5700 if income_c==1 & Country == "Poland"
replace income_real=6300 if income_c==2 & Country == "Poland"
replace income_real=6900 if income_c==3 & Country == "Poland"
replace income_real=7900 if income_c==4 & Country == "Poland"

replace income_thousands_ppp=2.460 if income_c==0 & Country == "Poland"
replace income_thousands_ppp=2.767 if income_c==1 & Country == "Poland"
replace income_thousands_ppp=3.075 if income_c==2 & Country == "Poland"
replace income_thousands_ppp=3.382 if income_c==3 & Country == "Poland"
replace income_thousands_ppp=3.843 if income_c==4 & Country == "Poland"

*Portugal
replace income_real=1300 if income_c==0 & Country == "Portugal"
replace income_real=1500 if income_c==1 & Country == "Portugal"
replace income_real=1700 if income_c==2 & Country == "Portugal"
replace income_real=1900 if income_c==3 & Country == "Portugal"
replace income_real=2100 if income_c==4 & Country == "Portugal"

replace income_thousands_ppp=2.128 if income_c==0 & Country == "Portugal"
replace income_thousands_ppp=2.394 if income_c==1 & Country == "Portugal"
replace income_thousands_ppp=2.660 if income_c==2 & Country == "Portugal"
replace income_thousands_ppp=2.926 if income_c==3 & Country == "Portugal"
replace income_thousands_ppp=3.325 if income_c==4 & Country == "Portugal"

*Sweden
replace income_real=32200 if income_c==0 & Country == "Sweden"
replace income_real=36200 if income_c==1 & Country == "Sweden"
replace income_real=40200 if income_c==2 & Country == "Sweden"
replace income_real=44200 if income_c==3 & Country == "Sweden"
replace income_real=50300 if income_c==4 & Country == "Sweden"

replace income_thousands_ppp=3.360 if income_c==0 & Country == "Sweden"
replace income_thousands_ppp=3.781 if income_c==1 & Country == "Sweden"
replace income_thousands_ppp=4.201 if income_c==2 & Country == "Sweden"
replace income_thousands_ppp=4.621 if income_c==3 & Country == "Sweden"
replace income_thousands_ppp=5.251 if income_c==4 & Country == "Sweden"

*UK
replace income_real=2700 if income_c==0 & Country == "UK"
replace income_real=3100 if income_c==1 & Country == "UK"
replace income_real=3400 if income_c==2 & Country == "UK"
replace income_real=3700 if income_c==3 & Country == "UK"
replace income_real=4200 if income_c==4 & Country == "UK"

replace income_thousands_ppp=3.599 if income_c==0 & Country == "UK"
replace income_thousands_ppp=4.049 if income_c==1 & Country == "UK"
replace income_thousands_ppp=4.499 if income_c==2 & Country == "UK"
replace income_thousands_ppp=4.949 if income_c==3 & Country == "UK"
replace income_thousands_ppp=5.623 if income_c==4 & Country == "UK"


************
* ANALYSIS 
************

encode ResponseId, gen(ID)

*** Normalized income 

* Choice 

forvalues i=1(1)7{
reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i'	///
		, absorb(ID round ID#round) vce(cl ID) 
est store ch_stand_`i'
	
}


* Rating
forvalues i=1(1)7{ 
reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 

est store rat_stand_`i'
}

*** PPT income 

preserve // To restore dataset after estimation 
drop income_norm // To treat it as the same variable in the coefplots
rename income_thousands_ppp income_norm

* Choice
forvalues i=1(1)7{ 
reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 
	
est store ch_ppp_`i'
}

* Rating 
forvalues i=1(1)7{
reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 

est store rat_ppp_`i'
}

restore

** Globals for coefplots
global hun label(Hungary) mlcolor(dkgreen) ciopts(color(dkgreen)) msymbol(O)
global isr label(Israel) mlcolor(blue)  ciopts(color(blue)) msymbol(D)
global pol label(Poland) mlcolor(red)  ciopts(color(red)) msymbol(T)
global por label(Portugal) mlcolor(lime) ciopts(color(lime)) msymbol(S)
global spa label(Spain) mlcolor(orange)  ciopts(color(orange)) msymbol(X) mlwidth(medium) msize(small)
global swe label(Sweden) mlcolor(purple) mfcolor(purple) ciopts(color(purple)) msymbol(+) mlwidth(medium) msize(small)
global uk label(UK) mlcolor(brown) mfcolor(brown) ciopts(color(brown))  msymbol(o)

*** Coefficient plot to summarize results 

* Without value labels for the body of the paper
* income normalized
coefplot 	(ch_stand_1, $hun) (ch_stand_2, $isr) (ch_stand_3, $pol) (ch_stand_4, $por) (ch_stand_5, $spa) (ch_stand_6, $swe) (ch_stand_7, $uk), bylabel("Choice" "Income: Normalized") subtitle(, size(vsmall))	///
			|| (rat_stand_1, $hun) (rat_stand_2, $isr) (rat_stand_3, $pol) (rat_stand_4, $por) (rat_stand_5, $spa) (rat_stand_6, $swe) (rat_stand_7, $uk), bylabel("Rating:" "Income: Normalized")	///
			|| , drop(?cons) xline(0, lp(solid) lcol(red)) levels(95) ///
			coeflabels(1.elections_c= `""{bf:Elections:}" "{bf:Not Free}" "(baseline: Free)"'	///
			1.media_c= `""{bf:Media:}" "{bf: Too critical censored}" "(baseline: Allowed openly criticise)" "' ///
			1.protest_c = `""{bf:Protests and demonstrations:}" "{bf:Opposition demonstrations restricted}" "(baseline: Opposition free to demonstrate)""' ///
			1.laws_c = `""{bf:Laws:}" "{bf: Gov. bends the law }" "(baseline: Gov. follows law)""' ///
			1.parliament_c = `""{bf:Parliament:}" "{bf: Gov. bypasses parliament}" "(baseline: Gov. subject to control)""'	///
			1.judges_c = `""{bf:Judges and courts:}" "{bf: Gov. ignores court rulings }" "(baseline: Gov. abides by court rulings)""'	///
			income_norm = "{bf:Income}", labsize(vsmall)) ///
			byopts(rows(1) xrescale) msize(small) mfcolor(none) ///
			legend(colfirst rows(1) size(vsmall))
		
graph export "${output}Figure_1.pdf", replace


* income in $PPP
coefplot 	(ch_ppp_1, $hun) (ch_ppp_2, $isr) (ch_ppp_3, $pol) (ch_ppp_4, $por) (ch_ppp_5, $spa) (ch_ppp_6, $swe) (ch_ppp_7, $uk), bylabel("Choice:" "Income $1,000 PPP") subtitle(, size(vsmall))	///
			|| (rat_ppp_1, $hun) (rat_ppp_2, $isr) (rat_ppp_3, $pol) (rat_ppp_4, $por) (rat_ppp_5, $spa) (rat_ppp_6, $swe) (rat_ppp_7, $uk), bylabel("Rating:" "Income $1,000 PPP")	///
			|| , drop(?cons) xline(0, lp(solid) lcol(red)) levels(95) ///
			coeflabels(1.elections_c= `""{bf:Elections:}" "{bf:Not Free}" "(baseline: Free)"'	///
			1.media_c= `""{bf:Media:}" "{bf: Too critical censored}" "(baseline: Allowed openly criticise)" "' ///
			1.protest_c = `""{bf:Protests and demonstrations:}" "{bf:Opposition demonstrations restricted}" "(baseline: Opposition free to demonstrate)""' ///
			1.laws_c = `""{bf:Laws:}" "{bf: Gov. bends the law }" "(baseline: Gov. follows law)""' ///
			1.parliament_c = `""{bf:Parliament:}" "{bf: Gov. bypasses parliament}" "(baseline: Gov. subject to control)""'	///
			1.judges_c = `""{bf:Judges and courts:}" "{bf: Gov. ignores court rulings }" "(baseline: Gov. abides by court rulings)""'	///
			income_norm = "{bf:Income}", labsize(vsmall)) ///
			byopts(rows(1) xrescale) msize(small) mfcolor(none) ///
			legend(colfirst rows(1) size(vsmall))
		
graph export "${output}Figure_D1.pdf", replace


* With value labels for the appendix
*income normalized 
coefplot 	(ch_stand_1, $hun) (ch_stand_2, $isr) (ch_stand_3, $pol) (ch_stand_4, $por) (ch_stand_5, $spa) (ch_stand_6, $swe) (ch_stand_7, $uk), bylabel("Choice" "Income: Normalized") subtitle(, size(vsmall))	///
			|| (rat_stand_1, $hun) (rat_stand_2, $isr) (rat_stand_3, $pol) (rat_stand_4, $por) (rat_stand_5, $spa) (rat_stand_6, $swe) (rat_stand_7, $uk), bylabel("Rating:" "Income: Normalized")	///
			|| , drop(?cons) xline(0, lp(solid) lcol(red)) levels(95) ///
			coeflabels(1.elections_c= `""{bf:Elections:}" "{bf:Not Free}" "(baseline: Free)"'	///
			1.media_c= `""{bf:Media:}" "{bf: Too critical censored}" "(baseline: Allowed openly criticise)" "' ///
			1.protest_c = `""{bf:Protests and demonstrations:}" "{bf:Opposition demonstrations restricted}" "(baseline: Opposition free to demonstrate)""' ///
			1.laws_c = `""{bf:Laws:}" "{bf: Gov. bends the law }" "(baseline: Gov. follows law)""' ///
			1.parliament_c = `""{bf:Parliament:}" "{bf: Gov. bypasses parliament}" "(baseline: Gov. subject to control)""'	///
			1.judges_c = `""{bf:Judges and courts:}" "{bf: Gov. ignores court rulings }" "(baseline: Gov. abides by court rulings)""'	///
			income_norm = "{bf:Income}", labsize(vsmall)) ///
			addplot(scatter @at @ul, ms(i) mlabel(@b) mlabformat("%9.1f") mlabposition(3) mlabcolor(black) mlabsize(tiny)) ///
			byopts(rows(1) xrescale) msize(small) mfcolor(none) ///
			legend(colfirst rows(1) size(vsmall))
		
graph export "${output}Figure_D2.pdf", replace

*income in PPP$
coefplot 	(ch_ppp_1, $hun) (ch_ppp_2, $isr) (ch_ppp_3, $pol) (ch_ppp_4, $por) (ch_ppp_5, $spa) (ch_ppp_6, $swe) (ch_ppp_7, $uk), bylabel("Choice:" "Income $1,000 PPP") subtitle(, size(vsmall))	///
			|| (rat_ppp_1, $hun) (rat_ppp_2, $isr) (rat_ppp_3, $pol) (rat_ppp_4, $por) (rat_ppp_5, $spa) (rat_ppp_6, $swe) (rat_ppp_7, $uk), bylabel("Rating:" "Income $1,000 PPP")	///
			|| , drop(?cons) xline(0, lp(solid) lcol(red)) levels(95) ///
			coeflabels(1.elections_c= `""{bf:Elections:}" "{bf:Not Free}" "(baseline: Free)"'	///
			1.media_c= `""{bf:Media:}" "{bf: Too critical censored}" "(baseline: Allowed openly criticise)" "' ///
			1.protest_c = `""{bf:Protests and demonstrations:}" "{bf:Opposition demonstrations restricted}" "(baseline: Opposition free to demonstrate)""' ///
			1.laws_c = `""{bf:Laws:}" "{bf: Gov. bends the law }" "(baseline: Gov. follows law)""' ///
			1.parliament_c = `""{bf:Parliament:}" "{bf: Gov. bypasses parliament}" "(baseline: Gov. subject to control)""'	///
			1.judges_c = `""{bf:Judges and courts:}" "{bf: Gov. ignores court rulings }" "(baseline: Gov. abides by court rulings)""'	///
			income_norm = "{bf:Income}", labsize(vsmall)) ///
			addplot(scatter @at @ul, ms(i) mlabel(@b) mlabformat("%9.1f") mlabposition(3) mlabcolor(black) mlabsize(tiny)) ///
			byopts(rows(1) xrescale) msize(small) mfcolor(none) ///
			legend(colfirst rows(1) size(vsmall))
		
graph export "${output}Figure_D3.pdf", replace


* Results with the pooled sample
reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm ///
		, absorb(ID round ID#round Country) vce(cl ID) 
		
est store ch_stand

reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm ///
		, absorb(ID round ID#round Country) vce(cl ID) 

est store rat_stand


*** PPT income for the pooled sample

preserve // To restore dataset after estimation 
drop income_norm // To treat it as the same variable in the coefplots
rename income_thousands_ppp income_norm
sum income_norm

reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm ///
		, absorb(ID round ID#round Country) vce(cl ID) 
	
est store ch_ppp

reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm  ///
		, absorb(ID round ID#round Country) vce(cl ID) 

est store rat_ppp

restore


coefplot 	(ch_stand), bylabel("Choice" "Income: Normalized") subtitle(, size(vsmall))	///
			|| (ch_ppp), bylabel("Choice:" "Income $1,000 PPP")	///
			|| (rat_stand), bylabel("Rating:" "Income: Normalized")	///
			|| (rat_ppp), bylabel("Rating:" "Income $1,000 PPP")	///
			|| , drop(?cons) xline(0, lp(solid) lcol(red)) levels(95) ///
			coeflabels(1.elections_c= `""{bf:Elections:}" "{bf:Not Free}" "(baseline: Free)"'	///
			1.media_c= `""{bf:Media:}" "{bf: Too critical censored}" "(baseline: Allowed openly criticise)" "' ///
			1.protest_c = `""{bf:Protests and demonstrations:}" "{bf:Opposition demonstrations restricted}" "(baseline: Opposition free to demonstrate)""' ///
			1.laws_c = `""{bf:Laws:}" "{bf: Gov. bends the law }" "(baseline: Gov. follows law)""' ///
			1.parliament_c = `""{bf:Parliament:}" "{bf: Gov. bypasses parliament}" "(baseline: Gov. subject to control)""'	///
			1.judges_c = `""{bf:Judges and courts:}" "{bf: Gov. ignores court rulings }" "(baseline: Gov. abides by court rulings)""'	///
			income_norm = "{bf:Income}", labsize(vsmall)) ///
		 addplot(scatter @at @ul, ms(i) mlabel(@b) mlabformat("%9.1f") mlabposition(3) mlabcolor(black) mlabsize(vsmall)) ///
			byopts(rows(1) xrescale)  ///
			legend(colfirst rows(1) size(vsmall))
			
graph export "${output}Figure_D4.pdf", replace


********** SECOND PART: WILLINGNESS TO PAY

**** Denominators of the WTP
* Denominator for normalized income 
global wtpdenom (0.01*abs(_b[income_norm]))

* Denominator For PPT income (
global wtpdenom2 (abs(_b[income_thousands_ppp]))
			
***** List of measures that we want and that we will use then in the specification: wtp of each component (the various ratios)

* For normalized income 
global bootstrap_normalized	(wtp1: (_b[1.elections_c])/ $wtpdenom )	/// 
							(wtp2: (_b[1.media_c])/ $wtpdenom )	///
							(wtp3: (_b[1.protest_c])/ $wtpdenom )	///
							(wtp4: (_b[1.laws_c])/ $wtpdenom )	///
							(wtp5: (_b[1.parliament_c])/ $wtpdenom )	///
							(wtp6: (_b[1.judges_c])/ $wtpdenom ) , post
					

* For PPT income. 

global bootstrap_PPT	(wtp1: (_b[1.elections_c])/ $wtpdenom2 )	/// 
						(wtp2: (_b[1.media_c])/ $wtpdenom2 )	///
						(wtp3: (_b[1.protest_c])/ $wtpdenom2 )	///
						(wtp4: (_b[1.laws_c])/ $wtpdenom2 )	///
						(wtp5: (_b[1.parliament_c])/ $wtpdenom2 )	///
						(wtp6: (_b[1.judges_c])/ $wtpdenom2 ), post			
			
**** Model estimation 

*** Normalized income 

* Choice 
forvalues i=1(1)7{
	reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i'	///
		, absorb(ID round ID#round) vce(cl ID) 
	
nlcom $bootstrap_normalized
eststo cho_stand_wtp_`i'
}


* Rating 
forvalues i=1(1)7{
reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_norm if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 

nlcom $bootstrap_normalized
eststo rat_stand_wtp_`i'
}
*** PPT income 

* Choice 
forvalues i=1(1)7{
reghdfe select i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_thousands_ppp if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 
	
nlcom $bootstrap_PPT
eststo cho_ppp_wtp_`i'
}

* Rating 
forvalues i=1(1)7{
reghdfe like i.elections_c i.media_c i.protest_c i.laws_c i.parliament_c i.judges_c income_thousands_ppp if Country_c==`i' ///
		, absorb(ID round ID#round) vce(cl ID) 

nlcom $bootstrap_PPT
eststo rat_ppp_wtp_`i'			
}		

* Globals for the tables
global estwtp keep(wtp1 wtp2 wtp3 wtp4 wtp5 wtp6)   coeflabels( wtp1 "Elections" wtp2   "Media"  wtp3 "Protests" wtp4   "Laws"  wtp5   "Parliament"  wtp6  "Judges"  ) order(wtp1 wtp2 wtp3 wtp4 wtp5 wtp6)     

global note addnotes("\footnotesize  Ratios of AMCEs. Standard errors in parenthesis. ACMEs estimated with individual-level" "round fixed effects. WTP as a percentage of the average income." "\sym{*} \(p<0.10\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\).")  substitute(\_ _)


* TABLE 2
esttab rat_stand_wtp_1 rat_stand_wtp_2 rat_stand_wtp_3 rat_stand_wtp_4 rat_stand_wtp_5 rat_stand_wtp_6 rat_stand_wtp_7 using "${output}TABLE_2.tex", replace $estwtp se mtitles("Hungary" "Israel" "Poland" "Portugal" "Spain" "Sweden" "UK")  $note nonote booktabs varwidth(0)

* TABLE 3
esttab rat_ppp_wtp_1 rat_ppp_wtp_2 rat_ppp_wtp_3 rat_ppp_wtp_4 rat_ppp_wtp_5 rat_ppp_wtp_6 rat_ppp_wtp_7 using "${output}TABLE_3.tex", replace $estwtp se mtitles("Hungary" "Israel" "Poland" "Portugal" "Spain" "Sweden" "UK")  $note nonote booktabs

**** THIRD PART. 

***** NOW WE MOVE TO THE INDIVIDUAL LEVEL ANALYSIS TO COMPUTE IMCEs

* Reversing conjoint attributes 
foreach var of varlist *_c {
	recode `var' (1=0) (0=1)
}


***** First we need to create a rolling number by individual from 0 to 10 that helps us in the estimation of some plots

bys ID: gen n=_n  

**** Now we use asreg (regression that can be combined with bysort) to compute individual-level coefficients,from which we can compute individual level weights and simulations based on IMCEs

*** CHOICE normalized income

* We estimate the model with asreg which allows the use of bysort. We bysort by individual (ID)
bysort ID: asreg select elections_c media_c protest_c laws_c parliament_c judges_c income_norm, robust

* We change the name of the generated variables so that they start with the prefix cho_
foreach var in _Nobs _R2 _adjR2 _b_elections_c _b_media_c _b_protest_c _b_laws_c _b_parliament_c _b_judges_c _b_income_norm _b_cons _se_elections_c _se_media_c _se_protest_c _se_laws_c _se_parliament_c _se_judges_c _se_income_norm _se_cons	{
	rename `var' cho`var'
}

*** RATING normalized income 
bysort ID: asreg like elections_c media_c protest_c laws_c parliament_c judges_c income_norm, robust

* We change the name of the generated variables so that they start with the prefix rat
foreach var in _Nobs _R2 _adjR2 _b_elections_c _b_media_c _b_protest_c _b_laws_c _b_parliament_c _b_judges_c _b_income_norm _b_cons _se_elections_c _se_media_c _se_protest_c _se_laws_c _se_parliament_c _se_judges_c _se_income_norm _se_cons	{
	rename `var' rat`var'
}

**** FIRST PANEL --> WTP 

*Create variables that we're going to fill:
gen increment=.

gen flipi_r_ii=.

*We compute the percentage supporting free elections by creating individual dummies of against/in favor, and use the loop for various income increases

local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5{
	local i=`i'+1

	local w=`z'*10

	gen flipi_r_ii`w'=1-((rat_b_income_norm*`z') > rat_b_elections_c) if n==1

	replace flipi_r_ii=1-(rat_b_income_norm*`z' > rat_b_elections_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income x `w'0 %"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick)) title("Elections", size(small)) ytitle("Predicted Support", size(small)) xtitle("Income increase (percentage)", size(small)) legend(ring(0) pos(2)) discrete colors(dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))

graph save "${aux}bin_elections_country.gph", replace
graph export "${aux}bin_elections_country.pdf", replace

drop increment flipi_r_ii flipi_r_ii0 flipi_r_ii1 flipi_r_ii3 flipi_r_ii5 flipi_r_ii10 flipi_r_ii30 flipi_r_ii50


*** Now we repeat this for all of our variables of interest 

* First we label the variables 
label var elections_c "Elections"
label var media_c "Media"
label var protest_c "Protests and demonstrations"
label var laws_c "Laws"
label var parliament_c "Parliament"
label var judges_c "Judges and courts"


foreach var of varlist elections_c media_c protest_c laws_c parliament_c judges_c{
	
	* We first recover variable label for graph title
	local lbe : variable label `var'
	
	gen increment=.
	
	gen flipi_r_ii=.
	
	local i=0
	foreach z in 0 0.1 0.3 0.5 1 3 5{
		local i=`i'+1

		local w=`z'*10

		gen flipi_r_ii`w'=1-((rat_b_income_norm*`z') > rat_b_`var') if n==1

		replace flipi_r_ii=1-(rat_b_income_norm*`z' > rat_b_`var') if n==`i'

		replace increment=`w'*10 if n==`i'

		label var flipi_r_ii`w' "Income x `w'0 %"
	}

	binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase (percentage)") name(`var', replace) legend(ring(0) pos(6) rows(1)) discrete ytitle("Predicted Support", size(small)) ti("`lbe'", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 		"Sweden") label(7 "UK"))
	
	graph save "${aux}bin_`var'.gph", replace
	
	drop increment flipi_r_ii flipi_r_ii0 flipi_r_ii1 flipi_r_ii3 flipi_r_ii5 flipi_r_ii10 flipi_r_ii30 flipi_r_ii50

}

* Combining the plots for summary
grc1leg			"${aux}bin_elections_c"	///
				"${aux}bin_media_c"	///
				"${aux}bin_protest_c"	///
				"${aux}bin_laws_c"	///
				"${aux}bin_parliament_c"	///
				"${aux}bin_judges_c"	///
				, pos(6) 
				
graph export "${output}FIGURE_2.pdf", replace
				
*** THEORETICALLY INFORMED BUNDLES OF "ALTERNATIVE" CONFIGURATIONS OF DEMOCRACY

** Elections / Liberal public sphere / Checks and balances (No need to repeat the estimation for elections since it is always the same and we can recover the original plot)

* Liberal public sphere 
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5{
	local i=`i'+1

	local w=`z'*10

	gen flipi_r_ii`w'=1-((rat_b_income_norm*`z') > rat_b_media_c + rat_b_protest_c) if n==1

	replace flipi_r_ii=1-(rat_b_income_norm*`z' > rat_b_media_c + rat_b_protest_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income x `w'0 %"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase (percentage)",size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Liberal public sphere", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_liberal_ps_country.gph", replace
	
drop increment flipi_r_ii flipi_r_ii0 flipi_r_ii1 flipi_r_ii3 flipi_r_ii5 flipi_r_ii10 flipi_r_ii30 flipi_r_ii50



* Checks and balances 
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5{
	local i=`i'+1

	local w=`z'*10

	gen flipi_r_ii`w'=1-((rat_b_income_norm*`z') > rat_b_laws_c + rat_b_parliament_c + rat_b_judges_c) if n==1

	replace flipi_r_ii=1-(rat_b_income_norm*`z' > rat_b_laws_c + rat_b_parliament_c + rat_b_judges_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income x `w'0 %"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase (percentage)", size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Checks and balances", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_checks_country.gph", replace
	
drop increment flipi_r_ii flipi_r_ii0 flipi_r_ii1 flipi_r_ii3 flipi_r_ii5 flipi_r_ii10 flipi_r_ii30 flipi_r_ii50



* Electoral democracy / Liberal democracy 

* Liberal components all bundled together
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5{
	local i=`i'+1

	local w=`z'*10

	gen flipi_r_ii`w'=1-((rat_b_income_norm*`z') > rat_b_media_c + rat_b_protest_c + rat_b_laws_c + rat_b_parliament_c + rat_b_judges_c) if n==1

	replace flipi_r_ii=1-(rat_b_income_norm*`z' > rat_b_media_c + rat_b_protest_c + rat_b_laws_c + rat_b_parliament_c + rat_b_judges_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income x `w'0 %"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase (percentage)", size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Liberal principles", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_liberal_all_country.gph", replace
	
drop increment flipi_r_ii flipi_r_ii0 flipi_r_ii1 flipi_r_ii3 flipi_r_ii5 flipi_r_ii10 flipi_r_ii30 flipi_r_ii50

* Combining the plots for summary
graph combine 	"${aux}bin_elections_country.gph"	///
				"${aux}bin_liberal_ps_country.gph"	///
				"${aux}bin_checks_country.gph"	///
				"${aux}bin_liberal_all_country.gph"	///
				, ycommon 
				

graph export "${output}FIGURE_3.pdf", replace
				
***************************************************
** REPLICATION OF PREVIOUS ANALYSIS USING PPP$	***			
***************************************************

*** CHOICE: PPP$

* We estimate the model with asreg which allows the use of bysort. We bysort by individual (ID)
bysort ID: asreg select elections_c media_c protest_c laws_c parliament_c judges_c income_thousands_ppp, robust

* We change the name of the generated variables so that they start with the prefix cho_ppp
foreach var in _Nobs _R2 _adjR2 _b_elections_c _b_media_c _b_protest_c _b_laws_c _b_parliament_c _b_judges_c _b_income_thousands_ppp _b_cons _se_elections_c _se_media_c _se_protest_c _se_laws_c _se_parliament_c _se_judges_c _se_income_thousands_ppp _se_cons	{
	rename `var' cho_ppp`var'
}

*** RATING PPP$
bysort ID: asreg like elections_c media_c protest_c laws_c parliament_c judges_c income_thousands_ppp, robust

* We change the name of the generated variables so that they start with the prefix rat_ppp
foreach var in _Nobs _R2 _adjR2 _b_elections_c _b_media_c _b_protest_c _b_laws_c _b_parliament_c _b_judges_c _b_income_thousands_ppp _b_cons _se_elections_c _se_media_c _se_protest_c _se_laws_c _se_parliament_c _se_judges_c _se_income_thousands_ppp _se_cons	{
	rename `var' rat_ppp`var'
}

******* FOURTH PART: SIMULATIONS: PREDICTED LEVEL OF PUBLIC SUPPORT FOR VARIOUS ALTERNATIVE SOCIETIES 

**** FIRST PANEL --> WTP 

*Create variables that we're going to fill:
gen increment=.

gen flipi_r_ii=.

*We compute the percentage supporting free elections by creating individual dummies of against/in favor, and use the loop for various income increases

local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5 7 9 11 13 15{
	local i=`i'+1

	local w=`z'*100

	gen flipi_r_ii`w'=1-((rat_ppp_b_income_thousands_ppp*`z') > rat_ppp_b_elections_c) if n==1

	replace flipi_r_ii=1-(rat_ppp_b_income_thousands_ppp*`z' > rat_ppp_b_elections_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income + `w'0 PPP$"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick)) title("Elections", size(small)) ytitle("Predicted Support", size(small)) xtitle("Income increase in PPP$", size(small)) legend(ring(0) pos(2)) discrete colors(dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))

graph save "${aux}bin_elections_country_ppp.gph", replace
graph export "${aux}bin_elections_country_ppp.pdf", replace

drop increment flipi_r_ii* 

*** Now we repeat this for all of our variables of interest 

* First we label the variables 
label var elections_c "Elections"
label var media_c "Media"
label var protest_c "Protests and demonstrations"
label var laws_c "Laws"
label var parliament_c "Parliament"
label var judges_c "Judges and courts"


foreach var of varlist elections_c media_c protest_c laws_c parliament_c judges_c{
	
	* We first recover variable label for graph title
	local lbe : variable label `var'
	
	gen increment=.
	
	gen flipi_r_ii=.
	
	local i=0
	foreach z in 0 0.1 0.3 0.5 1 3 5 7 9 11 13 15{
		local i=`i'+1

		local w=`z'*100

		gen flipi_r_ii`w'=1-((rat_ppp_b_income_thousands_ppp*`z') > rat_ppp_b_`var') if n==1

		replace flipi_r_ii=1-(rat_ppp_b_income_thousands_ppp*`z' > rat_ppp_b_`var') if n==`i'

		replace increment=`w'*10 if n==`i'

		label var flipi_r_ii`w' "Income + `w'0 PPP$"
	}

	binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase in PPP$") name(`var', replace) legend(ring(0) pos(6) rows(1)) discrete ytitle("Predicted Support", size(small)) ti("`lbe'", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 		"Sweden") label(7 "UK"))
	
	graph save "${aux}bin_`var'_ppp.gph", replace
	
	drop increment flipi_r_ii*

}

* Combining the plots for summary
grc1leg			"${aux}bin_elections_c_ppp"	///
				"${aux}bin_media_c_ppp"	///
				"${aux}bin_protest_c_ppp"	///
				"${aux}bin_laws_c_ppp"	///
				"${aux}bin_parliament_c_ppp"	///
				"${aux}bin_judges_c_ppp"	///
				, pos(6)
				
graph export "${output}Figure_D5.pdf", replace				
				

*** Now we do this for theoretically informed bundles 

** Elections / Liberal public sphere / Checks and balances (No need to repeat the estimation for elections since it is always the same and we can recover the original plot)

* Liberal public sphere 
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5 7 9 11 13 15{
	local i=`i'+1

	local w=`z'*100

	gen flipi_r_ii`w'=1-((rat_ppp_b_income_thousands_ppp*`z') > rat_ppp_b_media_c + rat_ppp_b_protest_c) if n==1

	replace flipi_r_ii=1-(rat_ppp_b_income_thousands_ppp*`z' > rat_ppp_b_media_c + rat_ppp_b_protest_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income + `w'0 PPP$"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase in PPP$",size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Liberal public sphere", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_liberal_ps_country_ppp.gph", replace
	
drop increment flipi_r_ii*


* Checks and balances 
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5 7 9 11 13 15{
	local i=`i'+1

	local w=`z'*100

	gen flipi_r_ii`w'=1-((rat_ppp_b_income_thousands_ppp*`z') > rat_ppp_b_laws_c + rat_ppp_b_parliament_c + rat_ppp_b_judges_c) if n==1

	replace flipi_r_ii=1-(rat_ppp_b_income_thousands_ppp*`z' > rat_ppp_b_laws_c + rat_ppp_b_parliament_c + rat_ppp_b_judges_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income + `w'0 PPP$"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase in PPP$", size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Checks and balances", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_checks_country_ppp.gph", replace
	
drop increment flipi_r_ii*


* Electoral democracy / Liberal democracy 

* Liberal components all bundled together
gen increment=.
	
gen flipi_r_ii=.
	
local i=0
foreach z in 0 0.1 0.3 0.5 1 3 5 7 9 11 13 15{
	local i=`i'+1

	local w=`z'*100

	gen flipi_r_ii`w'=1-((rat_ppp_b_income_thousands_ppp*`z') > rat_ppp_b_media_c + rat_ppp_b_protest_c + rat_ppp_b_laws_c + rat_ppp_b_parliament_c + rat_ppp_b_judges_c) if n==1

	replace flipi_r_ii=1-(rat_ppp_b_income_thousands_ppp*`z' > rat_ppp_b_media_c + rat_ppp_b_protest_c + rat_ppp_b_laws_c + rat_ppp_b_parliament_c + rat_ppp_b_judges_c) if n==`i'

	replace increment=`w'*10 if n==`i'

	label var flipi_r_ii`w' "Income + `w'0 PPP$"
}

binscatter flipi_r_ii increment, by(Country_c) linetype(connect) yline(0.5, lwidth(thick))  xtitle("Income increase in PPP$", size(small)) legend(ring(0) pos(2)) discrete ytitle("Predicted Support", size(small)) ti("Liberal principles", size(small)) colors(	dkgreen blue red lime orange purple brown) msymbols(circle_hollow diamond_hollow triangle_hollow square_hollow X + circle) legend(cols(2) region(color(none)) size(vsmall) label(1 "Hungary") label(2 "Israel") label(3 "Poland") label(4 "Portugal") label(5 "Spain") label(6 "Sweden") label(7 "UK"))
	
graph save "${aux}bin_liberal_all_country_ppp.gph", replace
	
drop increment flipi_r_ii* 

* Combining the plots for summary
graph combine 	"${aux}bin_elections_country_ppp.gph"	///
				"${aux}bin_liberal_ps_country_ppp.gph"	///
				"${aux}bin_checks_country_ppp.gph"	///
				"${aux}bin_liberal_all_country_ppp.gph"	///
				, ycommon 
				

graph export "${output}Figure_D6.pdf", replace
								
				
